module.exports = function ({UsersFinances, sequelize}) {

    /**
     * 统计分析 V2
     */
    UsersFinances.analyseV2 = function () {
        let sql = "select type, count(*) count, ifnull(sum(amount),0) amount from UsersFinances group by type";
        return sequelize.query(sql, {
            type: sequelize.QueryTypes.SELECT
        });
    }

}